package com.qkl.xiatang.app.entity.device;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

@Data
@TableName(value = "device_normal")
public class DeviceNormalEntity {

    @TableId(type= IdType.AUTO)
    private String id;

    private String companyId;

    /**
     * 0 电池电压,1 pH值,2 盐度,3 水温,4 溶解氧,5 氨氮,6 亚硝酸盐
     */
    private Integer type;

    private Double normalMin;

    private Double normalMax;

    private Double valueMin;

    private Double valueMax;

    private String unit;

    public String normalValue(){
        if(null == normalMin  && null != normalMax){
            return "小于" + normalMax;
        }
        if(null != normalMin  && null == normalMax){
            return "大于" + normalMin;
        }
        if(null != normalMin  && null != normalMax){
            return normalMin + "~" +  normalMax;
        }
        return "";
    }

}
